package biolabs.space;

/**
 * Abstract class for a position in a continuous vector space.
 *
 * @author Tomas Mikula
 */
public abstract class ContinuousPosition<C extends ContinuousPosition<C,P>, P extends DiscretePosition<P,C>>
		extends Position<C, Double> {
	/**
	 * Division by a scalar.
	 * @param k the divisor
	 * @return A new position with each coordinate divided by {@code k}
	 * @throws IllegalArgumentException if {@code k} is zero.
	 */
	public abstract C divide(double k);

	/**
	 * Normalization.
	 * @return A position of same direction as this position and
	 *  length (approximately) 1. If this is a zero vector, returns this.
	 */
	public abstract C normalized();

	/**
	 * Rounds each coordinate.
	 * @return A discrete position whose each coordinate is the
	 * rounded value of this position's corresponding coordinate. 
	 */
	public abstract P rounded();
}
